package com.renli.controller;

import io.swagger.annotations.*;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Api(value = "swagger测试", tags = "测试接口")
@Controller("swaggertest")
public class TestController {


    @ApiOperation(value = "test接口", notes = "用于测试的方法.测试swagger接口", httpMethod = "get",
            response = String.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "username", value = "用户名", paramType = "query", dataType = "String",
                    required = true),
            @ApiImplicitParam(name = "password", value = "密码", paramType = "query", dataType = "String",
                    required = true)
    })
    @RequestMapping(value = "/test1", method = RequestMethod.GET)
    @ResponseBody
    public String test(@RequestParam("username") String username, @RequestParam("password") String password) {
        System.out.println(username + "==>" + password);
        return username + password;
    }

 /*   @ApiOperation(value = "test2接口", notes = "用于测试的方法.测试swagger接口", httpMethod = "post",
            response = String.class)
    @RequestMapping(value = "/test2", method = RequestMethod.POST)
    @ResponseBody
    public User test2(@RequestBody @ApiParam(name = "user", value = "用户名和密码", required = true) User user) {
        System.out.println(user);
        return user;
    }*/
/*
    @ApiOperation(value = "test3接口", notes = "用于测试的方法.测试swagger接口", httpMethod = "post",
            response = String.class)
    @RequestMapping(value = "/test3", method = RequestMethod.POST)
    @ResponseBody
    public User test3(@RequestBody @ApiParam(name = "user", value = "用户名和密码", required = true) User user) {
        System.out.println(user);
        return user;
    }*/



}


